package com.cn.lp.feign.base;

import com.cn.lp.common.utils.BlankAide;
import com.cn.lp.feign.param.RequestParam;
import feign.Param;

/**
 * param 处理器
 */
public class ParameterExpander implements Param.Expander {

    @Override
    public String expand(Object value) {
        if(BlankAide.isBlank(value)) {
            return null;
        }
        if(value instanceof RequestParam) {
            RequestParam requestParam = (RequestParam) value;
            requestParam.initMap();
            return "requestParam.initMap()";
        }
        return value.toString();
    }

}
